#version 330 core

uniform sampler2D _texture0;
uniform sampler2D _texture1;
uniform sampler2D _texture2;
uniform sampler2D _texture3;
uniform sampler2D _texture4;
uniform sampler2D _texture5;
uniform sampler2D _texture6;
uniform sampler2D _texture7;

in vec2 texCoord;
flat in int texID;

out vec4 FragOut;

void main()
{
    // int texID_int = int(floor(0.5 + texID));
    vec4 texture_frag;
    switch(texID)
    {
        case 0: texture_frag = texture(_texture0, texCoord); break;
        case 1: texture_frag = texture(_texture1, texCoord); break;
        case 2: texture_frag = texture(_texture2, texCoord); break;
        case 3: texture_frag = texture(_texture3, texCoord); break;
        case 4: texture_frag = texture(_texture4, texCoord); break;
        case 5: texture_frag = texture(_texture5, texCoord); break;
        case 6: texture_frag = texture(_texture6, texCoord); break;
        case 7: texture_frag = texture(_texture7, texCoord); break;
        default: texture_frag = texture(_texture0, texCoord); break;
    }

    FragOut = texture_frag;
}